package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.atguigu.jxc.entity.GoodsType;
import com.atguigu.jxc.entity.Unit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface GoodsMapper {

    List<Goods> getList(@Param("codeOrName") String codeOrName, @Param("goodsTypeId") String goodsTypeId);

    List<GoodsType> getTypeList(@Param("pId") Integer pId);

    List<Unit> getUnitList();

    void saveType(@Param("goodsTypeName") String goodsTypeName, @Param("pId") Integer pId);

    void delType(@Param("goodsTypeId") Integer goodsTypeId);

    void insertGoods(@Param("goods") Goods goods);

    void updateGoods(@Param("goods") Goods goods);

    Goods getGoods(@Param("goodsId") Integer goodsId);

    void delGoods(@Param("goodsId") Integer goodsId);

    ArrayList<String> getGoodsCode();

    List<Goods> getNoInventoryQuantity(@Param("nameOrCode") String nameOrCode);

    List<Goods> getHasInventoryQuantity(@Param("nameOrCode")String nameOrCode);

    void updateStock(@Param("goodsId") Integer goodsId, @Param("inventoryQuantity") Integer inventoryQuantity, @Param("purchasingPrice") double purchasingPrice);

    void delStock(@Param("goodsId") Integer goodsId);

    void addStockList(ArrayList<Goods> goodss);
    void cutStockList(ArrayList<Goods> goodss);
}
